<%@page import="com.shsh.safemanage.model.Department1"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.action.ActionCreator"%>
<%@page import="com.shsh.safemanage.action.WriteProblemAction"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.TitlePostManageGroupDao"%>
<%@page import="com.shsh.safemanage.model.JobPost"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@page import="com.shsh.safemanage.util.Constants"%>

<%
String theProblemIDStr = request.getParameter(Constants.REQUEST_PARAMETER_ID);
{
WriteProblemAction theWriteProblemAction = ActionCreator.createWriteProblemAction();
TitlePostManageGroupDao theTitlePostManageGroupDao = DaoCreator.createTitlePostManageGroupDao();
User theUser = (User) session.getAttribute(Constants.SESSION_USER);
JobPost thePost1 = theTitlePostManageGroupDao.getJobPostByID(theUser.getJobPost1ID());
JobPost thePost2 = theTitlePostManageGroupDao.getJobPostByID(theUser.getJobPost2ID());
JobPost thePost3 = theTitlePostManageGroupDao.getJobPostByID(theUser.getJobPost3ID());

int intRole = theWriteProblemAction.calRole(thePost1, thePost2, thePost3);
%>
<%
if (theWriteProblemAction.showYiZhengGaiButton(thePost1, thePost2, thePost3)) {
%>
<input style="margin-left: 60px" type="radio" name="processRadio"
	id="processRadio1" onclick="chooseProcessMethod(1)" />
<span>确认已整改</span>
<%
}
%>
<%
if (theWriteProblemAction.showZhuanJiaoTaoRenButton(thePost1, thePost2, thePost3)) {
%>
<input style="margin-left: 30px" type="radio" name="processRadio"
	id="processRadio2" onclick="chooseProcessMethod(2)" />
<span>转发他人处理</span>
<%
}
%>
<%
if (theWriteProblemAction.showTuihuiButton(thePost1, thePost2, thePost3)) {
%>
<input style="margin-left: 30px" type="radio" name="processRadio"
	id="processRadio4" onclick="chooseProcessMethod(4)" />
<span>退回补充</span>
<%
}
%>
<%
if (theWriteProblemAction.showXiangGuanChuShiButton(thePost1, thePost2, thePost3)) {
%>
<input style="margin-left: 30px" type="radio" name="processRadio"
	id="processRadio5" onclick="chooseProcessMethod(5)" />
<a href="javascript:" onclick="openDialogPage('department1_list.jsp?departType=<%=Constants.DEPARTMENT_TYPE_JIGUAN%>', 'escalateUserDialog', '选择其他处室帮助处理')">相关处室协助解决</a>
<%
}
%>
<%
if (theWriteProblemAction.showShangBaoZhiNengChuShiButton(thePost1, thePost2, thePost3)) {
%>
<input style="margin-left: 30px" type="radio" name="processRadio"
	id="processRadio3" onclick="chooseProcessMethod(3)" />
<%
if ((intRole & Constants.ROLE_TYPE_BUZHANG) == 0) {
%>
<a href="javascript:" onclick="openDialogPage('feedback_escalate_userlist.jsp?id=<%=theProblemIDStr%>', 'escalateUserDialog', '选择上报领导')">上报职能处室</a>
<%
} else {
%>
<a href="javascript:" onclick="openDialogPage('department1_list.jsp?departType=<%=Constants.DEPARTMENT_TYPE_JIGUAN%>', 'escalateUserDialog', '选择上报处室')">上报职能处室</a>
<%
}
%>
<%
User escalateUser = (User) session.getAttribute(Constants.SESSION_ESCALATE_USER);
if (escalateUser != null) {
%>
<%=escalateUser.getName()%>
<%
}
%>
<%
}
%>
<%
Department1 escalateDepart1 = (Department1) session.getAttribute(Constants.SESSION_PROBLEM_DEPARTMENT1);
if (escalateDepart1 != null) {
%>
<%=escalateDepart1.getDepartmentName()%>
<%
}
%>
<%
}
%>

<script type="text/javascript">
function chooseMappingDepartment1(id) {
	$.dialog.get('escalateUserDialog').close();
	openWaitingDialog('waitingDialog');
	$.ajax({
		type:'post',
		url:'choose_department1_1_process.jsp',
		data:{
			id: id
		},
		success:function(data,state,xmlhttp){
			var obj = null;
			try {
				obj = eval('(' + data + ')');
			} catch (e) {
			}
			if (typeof(obj.isSuccess) != 'undefined') {
				if (obj.isSuccess == 'true') {
					loadPageSection('/safe_manage/feedback_process_method.jsp', 'feedbackProcessMethodDiv');
				} else {
					$.dialog.alert(obj.error);
				}
				closeWaitingDialog('waitingDialog');
			}
		}
	});
}
</script>